<template>
  <div class="activeDatas">
    <div class="title">
      预约信息
    </div>
    <el-form>
      <el-form-item label="城市：">
        <el-select v-model="valueCity" placeholder="全部" @change="pointChange">
          <el-option
            v-for="item in pointCity"
            :key="item.enName"
            :label="item.chName"
            :value="item.enName">
          </el-option>
        </el-select>
      </el-form-item>
    </el-form>
    <el-table :data="tableList" style="width: 100%" border>
      <el-table-column
        prop="date"
        width="120"
        >
      </el-table-column>
      <el-table-column label="注册人数">
        <el-table-column
          prop="registerStat.podium"
          label="DS"
          >
        </el-table-column>
        <el-table-column
          prop="registerStat.vip"
          label="VIP"
         >
        </el-table-column>
        <el-table-column
          prop="registerStat.sms"
          label="SMS"
          >
        </el-table-column>
      </el-table-column>
      <el-table-column label="到场人数">
        <el-table-column
          prop="arrivalStat.podium"
          label="DS"
         >
        </el-table-column>
        <el-table-column
          prop="arrivalStat.vip"
          label="VIP"
          >
        </el-table-column>
        <el-table-column
          prop="arrivalStat.sms"
          label="SMS"
          >
        </el-table-column>
      </el-table-column>
      <el-table-column label="到场次数">
        <el-table-column
          prop="arrivalTimesStat.podium"
          label="DS"
          >
        </el-table-column>
        <el-table-column
          prop="arrivalTimesStat.vip"
          label="VIP"
         >
        </el-table-column>
        <el-table-column
          prop="arrivalTimesStat.sms"
          label="SMS"
          >
        </el-table-column>
      </el-table-column>
    </el-table>
  </div>
</template>
<script>
  import axios from 'axios'
  import {CONST} from "../../js/utils";


  var pid = 0;
  export default {
    data() {
      return{
        valueCity: '全部',
        pointCity: [
          {'chName':'全部',enName: '全部'},
          {'chName':'成都',enName: 'chengdu'},
          {'chName':'合肥',enName: 'hefei'},
          {'chName':'深圳',enName: 'shenzhen'},
          {'chName':'上海',enName: 'shanghai'},
          {'chName':'西安',enName: 'xian'},
          {'chName':'哈尔滨',enName: 'haerbin'},
          {'chName':'南京',enName: 'nanjing'},
          {'chName':'兰州',enName: 'lanzhou'},
          ],
        tableList: [],
      }
    },
    methods: {
      pointChange() {
        this.getTableList()
      },
      getTableList() {
        console.log('9999')
        var cityValue = ''
        if(this.valueCity=='全部'){
          cityValue = '';
        }else{
          cityValue = this.valueCity;
        }
        let jsons = {
          city: cityValue,
          pid: pid
        }
        axios.post(CONST.URL.GET_DS,jsons)
          .then((result)=>{
           this.tableList = result.data.data;

          })
      }
    },
    mounted() {
      pid = localStorage.getItem('pid')
      this.getTableList()
    }
  }
</script>



<style>
  .activeDatas .title{
    text-align: left;
    font-size: 22px;
    color:#697882;
    margin-bottom: 20px;
    margin-top: 20px;
  }
  .el-form-item{
    float: left;
    width: 300px;
    box-sizing: border-box;
  }
 .activeDatas .el-table th>.cell{
    text-align: center;
  }
</style>
